#!bin/bash

# script path
script_path=$(dirname "$0")

echo $1

echo $2
in=$3
out=$4

echo $in
echo $out
# configfile path
# config_file="$script_path/../../../../conf/config.json"
config_file=$2

# extract managementip address
client_ip=$(jq -r '.ServerConfig.ipAddress' "$config_file")
management_ip=$(jq -r '.ServerConfig.managementIpAddress' "$config_file")
client_port=$(jq -r '.ServerConfig.port' "$config_file")
management_port=$(jq -r '.ServerConfig.managementPort' "$config_file")
model_name=$(jq -r '.BackendConfig.ModelDeployConfig.ModelConfig[0].modelName' "$config_file")
model_path=$(jq -r '.BackendConfig.ModelDeployConfig.ModelConfig[0].modelWeightPath' "$config_file")
datasetPath=$(jq -r '.BackendConfig.ModelDeployConfig.ModelConfig[0].modelWeightPath' "$config_file")

# echo $management_ip
# echo $management_port
# echo $model_name
# echo $model_path

export SMPL_PARAM='{"temperature":0.3,"top_k":100,"top_p":0.9,"repetition_penalty":1.01}'

   benchmark \
--DatasetPath "/home/jzx/data/$in.jsonl" \
--DatasetType "gsm8k" \
--ModelName $model_name \
--ModelPath $model_path \
--TestType client \
--Http http://$client_ip:$client_port \
--ManagementHttp http://$management_ip:$management_port \
--Concurrency 1000 \
--RequestRate $1 \
--MaxOutputLen $out \
--Tokenizer True \
# --DoSampling True \
# --SamplingParams $SMPL_PARAM \

